open Ast

let _ = 
  let rec boucle () =	  
    print_endline "Tapez: (`q` pour quitter)";
    let l = read_line() in
      match l with
	| s when s = "q" -> print_endline "The program is closed."
	| _ ->
	    let _ = 
	      Parser.expression Lexer.token(Lexing.from_string(l)) 
	    in
	      boucle ()
  in boucle ()

(* let _ = *)
(*   let i = Mlib.open_in_file Mlib.offsets_list in *)
(*   let in_ch = Mlib.open_in_file Mlib.fr_wiki in *)
(*   let l : int list = *)
(*      match Mlib.read_value i *)
(*      with None -> failwith "Error in main  read_value!" | Some s -> s *)
(*   in *)
(*   let index = int_of_string Sys.argv.(1) in *)
(*   let np = int_of_string Sys.argv.(2) in *)
(*   let en = index + np in *)
(*     Mlib.debug "Start reading %d pages on [%s] [%d]\n" np (Unix.gethostname ()) index; flush stderr; *)
(*     let cpt = ref 0 in *)
(*     for i = index to en  *)
(*     do *)
(*       (\* Mlib.read_value in_ch; *\) *)
(*       seek_in in_ch (List.nth l index); *)
(*       Mlib.read_page in_ch; *)
(*       incr cpt *)
(*     done; *)
(*     Mlib.debug "Done on %s %d\n" (Unix.gethostname ()) !cpt; flush stderr; *)
(*      close_in i; *)
(*      close_in in_ch *)

